p_height=2;
p_width=12;

output_name="/Volumes/Data/gSVN/ethernet-switch/paper/figures/900_300_NG_queue.eps"

#my_dir="/Volumes/Data/gSVN/ethernet-switch/paper/plots/two_flows/3COM_1_real/";
#my_dir="/Volumes/Data/gSVN/ethernet-switch/paper/plots/two_flows/NG_real/";
#my_dir="/Volumes/Data/gSVN/ethernet-switch/paper/plots/two_flows/3COM_1_analytical/";
#my_dir="/Volumes/Data/gSVN/ethernet-switch/paper/plots/two_flows/3COM_1_queue/";
#my_dir="/Volumes/Data/gSVN/ethernet-switch/paper/plots/two_flows/NG_analytical/";
my_dir="/Volumes/Data/gSVN/ethernet-switch/paper/plots/two_flows/NG_queue/";

flow1_time_filename=paste(my_dir, "900_300_flow1_time.txt", sep="");
flow1_delay_filename=paste(my_dir, "900_300_flow1_delay.txt", sep="");
flow2_time_filename=paste(my_dir, "900_300_flow2_time.txt", sep="");
flow2_delay_filename=paste(my_dir, "900_300_flow2_delay.txt", sep="");

flow1_time=scan(file=flow1_time_filename);
flow1_delay=scan(file=flow1_delay_filename);
flow2_time=scan(file=flow2_time_filename);
flow2_delay=scan(file=flow2_delay_filename);



#quartz();
postscript(output_name, height=p_height, width=p_width, horizontal=FALSE, onefile=TRUE);

#The four numbers in the call to par are the number of lines of text reserved on the bottom, left, top and right, respectively, ps: text size, mpg: margin size for title, axis label and axis
saved_par=par(mar=c(2.5,2.5,0,2)+0.1, ps=9, mgp=c(1.5,0.5,0));

plot(flow1_time, flow1_delay, col='black', type='p', xlab=NA, ylab=NA,ylim=c(-5,300), xlim=c(-20, 2500), xaxs='i', yaxs='i');

#plot(flow1_time, flow1_delay, col='black', type='p', xlab=NA, ylab=NA,ylim=c(-5,190), xlim=c(-20, 1400), xaxs='i', yaxs='i');

points(flow2_time, flow2_delay, col='red', pch=19, type='p');

#title(main="Low Load Traffic", ylab=expression(paste("Packet Delay (", mu, "s)", sep="")), xlab="Packet Size (Byte)");
title(main=NA, ylab=expression(paste("Delay(", mu, "s)/Loss", sep="")), xlab=expression(paste("Arrival Time(", mu, "s)", sep="")));

legend('topleft', legend=c('900 Mb/s Flow', '300 Mb/s Flow'), col=c('black', 'red'), pch=21:19, bty='n');

par(saved_par);

dev.off()